package net.sx.minemodule.mvp.bean;

import android.os.Parcel;
import android.os.Parcelable;

import com.alibaba.fastjson.annotation.JSONField;
import com.kedll.library.adapter.MultiTypeAdapter;
import com.kedll.library.mvp.BaseModel;

import net.sx.minemodule.mvp.item.GoodsItem;

/**
 * @author 11470
 */
public class GoodsBean extends BaseModel<GoodsItem> implements Parcelable {
    /**
     * "comdiyarry": [{
     *      * 					"attribute": "尺寸:XL,颜色:黑色",
     *      * 					"num": 1,
     *      * 					"title": "南极人男士内衣秋衣秋裤套装薄款保暖内衣棉男棉毛衫基础打底印花",
     *      * 					"bgimg": "/upath/2018/11/5/17545216854584ufi.png",
     *      * 					"sid": "M5jM6b2fyKK6xsI8qcwaYIBlJFKNjggLNK1/MMHjNh2PzeIRp7gq/+yEbYcXsmzV",
     *      * 					"check": false,
     *      * 					"isvalid": true,
     *      * 					"comdiymsg": ""
     *      *                                }],
     */
    @JSONField(alternateNames = {"bgimg"})
    private String goodsImgPath;
    @JSONField(alternateNames = {"title"})
    private String goodsName;

    private String attribute;
    private String num;
    private String sid;
    private String check;
    private String isvalid;
    private String comdiymsg;

    @Override
    public GoodsItem createItem(MultiTypeAdapter adapter) {
        return new GoodsItem(this);
    }

    @Override
    public String toString() {
        return "GoodsBean{" +
                "goodsImgPath='" + goodsImgPath + '\'' +
                ", goodsName='" + goodsName + '\'' +
                ", attribute='" + attribute + '\'' +
                ", num='" + num + '\'' +
                ", sid='" + sid + '\'' +
                ", check='" + check + '\'' +
                ", isvalid='" + isvalid + '\'' +
                ", comdiymsg='" + comdiymsg + '\'' +
                '}';
    }

    public String getGoodsImgPath() {
        return goodsImgPath;
    }

    public void setGoodsImgPath(String goodsImgPath) {
        this.goodsImgPath = goodsImgPath;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public String getAttribute() {
        return attribute;
    }

    public void setAttribute(String attribute) {
        this.attribute = attribute;
    }

    public String getNum() {
        return num;
    }

    public void setNum(String num) {
        this.num = num;
    }

    public String getSid() {
        return sid;
    }

    public void setSid(String sid) {
        this.sid = sid;
    }

    public String getCheck() {
        return check;
    }

    public void setCheck(String check) {
        this.check = check;
    }

    public String getIsvalid() {
        return isvalid;
    }

    public void setIsvalid(String isvalid) {
        this.isvalid = isvalid;
    }

    public String getComdiymsg() {
        return comdiymsg;
    }

    public void setComdiymsg(String comdiymsg) {
        this.comdiymsg = comdiymsg;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.goodsImgPath);
        dest.writeString(this.goodsName);
    }

    public GoodsBean() {
    }

    protected GoodsBean(Parcel in) {
        this.goodsImgPath = in.readString();
        this.goodsName = in.readString();
    }

    public static final Creator<GoodsBean> CREATOR = new Creator<GoodsBean>() {
        @Override
        public GoodsBean createFromParcel(Parcel source) {
            return new GoodsBean(source);
        }

        @Override
        public GoodsBean[] newArray(int size) {
            return new GoodsBean[size];
        }
    };
}
